package patterns.prototype;

/**
 * Created by lenovo on 2016/11/23 0023.
 * Shape图形抽象类，实现了cloneable接口，并重写clone方法。
 */
public abstract class AbsShape implements Cloneable{
    private String id;
    protected String type;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    abstract void draw();
    @Override
    public Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        }catch (CloneNotSupportedException e){
            e.printStackTrace();
        }
        return clone;
    }
}
